<template>
  <!--  -->
  <div>

    <div class="header">
      <span>搜索用户数</span>
      <svg
        t="1668743207226"
        class="icon"
        viewBox="0 0 1024 1024"
        version="1.1"
        xmlns="http://www.w3.org/2000/svg"
        p-id="2680"
        width="16"
        height="16"
      >
        <path
          d="M509.92 795.84c157.904 0 285.92-128.016 285.92-285.92C795.84 352 667.808 224 509.92 224 352 224 224 352 224 509.92c0 157.904 128 285.92 285.92 285.92z m0 48C325.504 843.84 176 694.32 176 509.92 176 325.504 325.504 176 509.92 176c184.416 0 333.92 149.504 333.92 333.92 0 184.416-149.504 333.92-333.92 333.92z m-2.448-400.704h16a16 16 0 0 1 16 16v201.728a16 16 0 0 1-16 16h-16a16 16 0 0 1-16-16V459.136a16 16 0 0 1 16-16z m0-100.176h16a16 16 0 0 1 16 16v23.648a16 16 0 0 1-16 16h-16a16 16 0 0 1-16-16v-23.648a16 16 0 0 1 16-16z"
          p-id="2681"
          fill="#dbdbdb"
        ></path>
      </svg>
    </div>

    <div class="title">
      <span class="title-left"> 12321 </span>
      <span> 17.1 <svg
                  t="1668744525605"
                  class="icon"
                  viewBox="0 0 1024 1024"
                  version="1.1"
                  xmlns="http://www.w3.org/2000/svg"
                  p-id="6320"
                  width="16"
                  height="16"
                >
                  <path
                    d="M512 405.333333L298.666667 618.666667h426.666666L512 405.333333z"
                    fill="#d81e06"
                    p-id="6321"
                  ></path></svg>
                  <svg
                  t="1668744414284"
                  class="icon"
                  viewBox="0 0 1024 1024"
                  version="1.1"
                  xmlns="http://www.w3.org/2000/svg"
                  p-id="5072"
                  width="16"
                  height="16"
                >
                  <path
                    d="M512 618.666667L298.666667 405.333333h426.666666L512 618.666667z"
                    fill="#1296db"
                    p-id="5073"
                  ></path>
                </svg>
                </span>
    </div>

    <div class="footer">
      <div ref="charts" class="charts"></div>
    </div>
  </div>
</template>

<script>
import * as echarts from "echarts";
export default {
  mounted() {
    this.myChart = echarts.init(this.$refs.charts);
    this.myChart.setOption({
      xAxis: {
        type: "category",
        show: false,
      },
      yAxis: {
        show: false,
      },
      // 图标样式
      series: [
        {
          data: [15, 23, 22, 21, 13, 17, 60, 12, 34, 12],
          type: "line",
          // 拐点设置
          itemStyle: {
            opacity: 0,
          },
          // 线条设置
          lineStyle: {
            color: "purple",
          },
          // 颜色渐变填充
          areaStyle: {
            color: {
              type: "linear",
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [
                {
                  offset: 0,
                  color: "purple", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "#fff", // 100% 处的颜色
                },
              ],
              global: false, // 缺省为 false
            },
          },
        },
      ],
      // 布局
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
      },
      // 悬浮提示
      tooltip: {
        show: true,
      },
    });
  },
};
</script>

<style scoped>
.charts {
  width: 100%;
  height: 50px;
}
.header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.header span {
  font-size: 14px;
  color: #ccc;
}
.title-left {
  margin-right: 10px;
  font-size: 22px;
}

</style>

